open-with-diaolog: set the default text according to the dialog mode
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 23 Nov 2010 11:47:16 +0000 (12:47 +0100)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 23 Nov 2010 15:53:22 +0000 (16:53 +0100)
gtk/gtkopenwithdialog.c

index fd0aca9e0d182dd3bdce976e2219d55042fc9c49..1b66152bc012e884d6b5cc65e9bc851b3a61767b 100644 (file)
@@ -224,7 +224,7 @@ get_extension (const char *basename)
 static void
 set_dialog_properties (GtkOpenWithDialog *self)
 {
-  char *label, *name, *extension, *description;
+  char *label, *name, *extension, *description, *default_text, *string;
   PangoFontDescription *font_desc;
 
   name = NULL;
@@ -245,6 +245,8 @@ set_dialog_properties (GtkOpenWithDialog *self)
     {
       /* Translators: %s is a filename */
       label = g_strdup_printf (_("Select an application to open \"%s\""), name);
+      string = g_strdup_printf (_("No applications available to open \"%s\""),
+                               name);
     }
   else
     {
@@ -252,6 +254,9 @@ set_dialog_properties (GtkOpenWithDialog *self)
       label = g_strdup_printf (_("Select an application for \"%s\" files"),
                               g_content_type_is_unknown (self->priv->content_type) ?
                               self->priv->content_type : description);
+      string = g_strdup_printf (_("No applications available to open \"%s\" files"),
+                              g_content_type_is_unknown (self->priv->content_type) ?
+                              self->priv->content_type : description);
     }
 
   font_desc = pango_font_description_new ();
@@ -261,10 +266,20 @@ set_dialog_properties (GtkOpenWithDialog *self)
 
   gtk_label_set_markup (GTK_LABEL (self->priv->label), label);
 
+  default_text = g_strdup_printf ("<big><b>%s</b></big>\n%s",
+                                 string,
+                                 _("Click \"Show other applications\", for more options, or "
+                                   "\"Find applications online\" to install a new application"));
+
+  gtk_open_with_widget_set_default_text (GTK_OPEN_WITH_WIDGET (self->priv->open_with_widget),
+                                        default_text);
+
   g_free (label);
   g_free (name);
   g_free (extension);
   g_free (description);
+  g_free (string);
+  g_free (default_text);
 }
 
 static void